<template>
	<view class="container">
		<block v-if="isload">
			<view class="header">
				<image :src="right_img"></image>
				<text v-if="detail.status == 1" style="color:#191919;font-size: 38rpx;">付款成功</text>
				<text v-else style="color:red;font-size: 38rpx;">未付款</text>
			</view>

			<view class="orderinfo">
				<view class="item">
					<text class="t1">下单人:</text>
					<text class="t2">{{ member.nickname }}</text>
				</view>
				<view class="item">
					<text class="t1">{{ t('会员') }}ID:</text>
					<text class="t2">{{ detail.mid }}</text>
				</view>
				<view class="item" v-if="business">
					<text class="t1">收款方:</text>
					<text class="t2">{{ business.name }}</text>
				</view>
				<view class="item">
					<text class="t1">订单号:</text>
					<text class="t2">{{ detail.ordernum }}</text>
				</view>
				<!--<view class="item" v-if="mendian">
				<text class="t1">付款门店</text>
				<text class="t2">{{mendian.name}}</text>
			</view>-->

				<view class="item">
					<text class="t1">订单金额:</text>
					<text class="t2">￥{{ detail.money }}</text>
				</view>
				<view class="item">
					<text class="t1">实付金额:</text>
					<text class="t2">￥{{ detail.paymoney }}</text>
				</view>
				<view class="item">
					<text class="t1">实际结算:</text>
					<text class="t2">￥{{ detail.realselectmoney || detail.money }}元</text>
				</view>

				<view class="item">
					<text class="t1">付款方式:</text>
					<text class="t2">{{ detail.paytype || '' }}</text>
				</view>
				<view class="item" v-if="detail.status > 0 && detail.paytime">
					<text class="t1">付款时间:</text>
					<text class="t2">{{ detail.paytime }}</text>
				</view>

				<view class="item" v-if="detail.businessdisprice > 0">
					<text class="t1">店铺折扣抵扣:</text>
					<text class="t2">-￥{{ detail.businessdisprice }}</text>
				</view>

				<view class="item" v-if="detail.fullmoney > 0">
					<text class="t1">店铺满减抵扣:</text>
					<text class="t2">-￥{{ detail.fullmoney }}</text>
				</view>

				<view class="item" v-if="detail.scoredk > 0">
					<text class="t1">{{ t('积分') }}抵扣:</text>
					<text class="t2">-￥{{ detail.scoredk }}</text>
				</view>
				<view class="item" v-if="detail.couponrid">
					<text class="t1">{{ t('优惠券') }}抵扣</text>
					<text class="t2">-￥{{ detail.couponmoney }}</text>
				</view>
				<view class="item" v-if="couponrecord">
					<text class="t1">{{ t('优惠券') }}名称</text>
					<text class="t2">{{ couponrecord.couponname }}</text>
				</view>
			</view>

		</block>
		<loading v-if="loading"></loading>
		<dp-tabbar :opt="opt"></dp-tabbar>
		<popmsg ref="popmsg"></popmsg>
	</view>
</template>

<script>
var app = getApp();

export default {
	data() {
		return {
			opt: {},
			loading: false,
			isload: false,
			menuindex: -1,

			detail: {},
			couponrecord: {},
			mendian: {},
			member: {},
			pre_url: getApp().globalData.pre_url,
			right_img: getApp().globalData.static_url + '/static/images/right.png'
		};
	},

	onLoad: function (opt) {
		this.opt = app.getopts(opt);
		this.getdata();
	},
	onPullDownRefresh: function () {
		this.getdata();
	},
	methods: {
		getdata: function (option) {
			var that = this;
			that.loading = true;
			app.get('AdminOrder/facepaydetail', {
				id: that.opt.id
			}, function (res) {
				that.loading = false;
				that.detail = res.detail;
				that.couponrecord = res.couponrecord;
				that.mendian = res.mendian;
				that.member = res.member;
				that.loaded();
			});
		},
	}
};
</script>
<style>
page {
	background-color: #f7f7f7;
}

.header {
	position: relative;
	width: 94%;
	margin: 20rpx 3%;
	border-radius: 5px;
	padding: 50rpx;
	background: #fff;
	text-align: center;
	display: flex;
	justify-content: center;
	align-items: center;
}

.header image {
	width: 42rpx;
	height: 42rpx;
	margin-right: 12rpx;
}

.orderinfo {
	width: 94%;
	margin: 20rpx 3%;
	border-radius: 5px;
	padding: 20rpx 20rpx;
	padding: 14rpx 3%;
	background: #FFF;
}

.orderinfo .item {
	display: flex;
	width: 100%;
	padding: 20rpx 0;
	border-bottom: 1px solid #ededed;
}

.orderinfo .item:last-child {
	border-bottom: 0;
}

.orderinfo .item .t1 {
	padding-right: 24rpx;
	color: #7e7e7e;
}

.orderinfo .item .t2 {
	flex: 1;
	color: #48484a;
}

.orderinfo .item .red {
	color: red
}

.goBusiness {
	color: #d5ca94;
	text-align: center;
	width: 90%;
	margin: auto;
	border-radius: 12rpx;
	border: 2rpx solid #e8622d;
	padding: 30rpx 0rpx;
	background-color: #fff;
	margin-top: 48rpx;
	margin-buttom: 48rpx;
}

.giveinfo {
	padding: 0rpx 40rpx;
}

.givetitle {
	color: #7c7c7c;
	font-size: 28rpx;
	margin: 40rpx 0rpx;
}

.givecontent {
	background: linear-gradient(#dd5734, #df7539);
	border-radius: 12rpx;
	padding: 40rpx;
	color: #fff;
	display: flex;
	justify-content: space-between;
}
</style>